package com.zbxx.service.Impl;


import com.zbxx.dao.UserDao;
import com.zbxx.domain.User;
import com.zbxx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;
    @Override
    public User login(String name, String password) {
        User user=userDao.login(name,password);
        return user;
    }

    @Override
    public List<User> SelectUserAll() {
        List<User> list=userDao.SelectUserAll();
        return list;
    }

    @Override
    public int deleteUser(Long id) {
        int num=userDao.deleteUser(id);
        return num;
    }

    @Override
    public User editUserId(Long id) {
        return userDao.editUserId(id);
    }

    @Override
    public int editUser(User user) {
        int num=userDao.editUser(user);
        return num;
    }

    @Override
    public int addUser(User user) {
        int num=userDao.addUser(user);
        return num;
    }

    @Override
    public int reg(User user) {
        int num =userDao.reg(user);
        return num;
    }

    @Override
    public List<User> findinfo(User name) {
        List<User> list2=userDao.findinfo(name);
        return list2;
    }

    @Override
    public int UpdatePwd(User name, String password, String password2) {
        int num=userDao.UpdatePwd(name,password,password2);
        return num;
    }

    @Override
    public int findNewCont() {
        int num=userDao.findNewCont();
        return num;
    }

    @Override
    public List<User> findNewsPage(int startPos, int pageSize) {
        List<User> list3=userDao.findNewsPage(startPos,pageSize);
        return list3;
    }
}
